import UiManager from "./UiManage";

const { ccclass, property } = cc._decorator;

@ccclass
export default class FindNodeViewCtrl extends cc.Component {
    @property(cc.Label)
    label_time = null;

    @property(cc.Sprite)
    spr_weather = null;

    @property(cc.Label)
    label_content = null;

    @property(cc.Label)
    label_city = null;

    start() { }

    initView(data) {
        if (data) {
            var t = data.city;
            var a = data.time;
            var o = data.weather;
            var i = data.des;

            this.label_time.string = a;
            UiManager.loadSpriteFrameInDeepPath(this.spr_weather, "absurface/weather/" + o);
            this.label_content.string = i;
            this.label_city.string = t;
        }
    }

    backBtnCallback() {
        this.node.active = false;
    }
}